import axios from "axios";

export default {
    get :({curPage,eachPage})=>axios.get("/api/users",{
        params:{
            curPage,
            eachPage
        }
    })
    .then(({data})=>data),

    addUsers :({username, password, phone, site, order, cartsId, coupons})=>axios.post("/api/users/addUser",{
        username, password, phone, site, order, cartsId, coupons
    })
    .then(({data})=>data),


    removeUsers :({ _id })=>axios.post("/api/users/removeUser",{
        _id
    })
    .then(({status})=>status),

    findOne :( _id )=>axios.get(`/api/users/findOne/${_id}`)
    .then(({data})=>data),

    
}